<?php
class Pay_style_model extends BZ_Model
{
    protected $table = 'pay_style';
    
    public function find($type=false)
    {
        $this->db->where('pay_type', 'line');
        $this->db->order_by('order', 'asc');
        $result = $this->db->get($this->table);
        if ($type) {
            $rows = array();
            foreach ($result->result_array() as $row) {
                $rows[$row['id']] = $row;
            }
            return $rows;
        }
        return $result;
    }
    
    public function findById($id)
    {
        $this->db->where('id', $id);
        return $this->db->get($this->table);
    }
}